#include  <msp430x20x3.h>

void main(void)
{
 	DCOCTL  = CALDCO_1MHZ;
 	BCSCTL1 = CALBC1_1MHZ;
    WDTCTL = WDT_ADLY_1000; // ACLK delay 1000ms (32kHz Crystal)
    //WDTCTL = WDT_ADLY_250; // ACLK delay 250ms (32kHz Crystal)
    //WDTCTL = WDT_ADLY_16; // ACLK delay 16ms (32kHz Crystal)
 	IE1 |= WDTIE;

  	P1DIR = 0xFF;			// All Port output direction
 	P1OUT = 0x01;
 	P2DIR = 0xFF;
 	P2OUT = 0;
 	
	_BIS_SR(LPM3_bits + GIE);
}

#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
    P1OUT ^= 0x01;          // Toggle P1.0 using exclusive-OR
    P1OUT ^= 0x40;          // Toggle P1.0 using exclusive-OR
	_BIC_SR_IRQ(LPM3_bits);
}

